<!--
  @author tanghongjun
  @since 2018/10/19 08:59
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common :: jscss">
    <title>产品描述</title>
</head>
<body>
<div class="layui-fluid">
    <blockquote class="layui-crumb">
        后台产品>产品分类>
        <a lay-href="/serv/categ/ass/list.action">分类关联</a>>
        <a th:href="|/serv/categ/ass/serviceItemView.action?groupId=${servAssCategory.groupId}|">检修提醒</a>
    </blockquote>

    <div class="layui-card">
        <div th:replace="servasscategory/_tab :: tab"></div>

        <div class="layui-card-body">
            <form method="post" action="" class="layui-form" lay-filter="zmn-form">
                <input type="hidden" name="groupId" th:value="${servAssCategory.groupId}"/>
                <div class="layui-form-item">
                    <script id="tstDrip" width="900px" maxlength="100" height="500px" name="tstDrip" type="text/plain">
                    </script>
                </div>

                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item submit">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">
                            提交
                        </button>
                        <a href="/serv/categ/ass/list.action"
                           class="layui-btn layui-btn-primary" text="取消">取消</a>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>

</body>
</html>

<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.js"></script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript" th:inline="javascript">
    var ue = UE.getEditor('tstDrip', {
        initialFrameHeight:500,
        initialFrameWidth:900
    });

    UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
    UE.Editor.prototype.getActionUrl = function(action) {
        // 这里很重要，很重要，很重要，要和配置中的imageActionName值一样
        if (action == 'uploadimage') {
            // 这里调用后端我们写的图片上传接口
            return '/ueditor/uploadImageData.action?folderName=servCategTstDrip';
        } else {
            return this._bkGetActionUrl.call(this, action);
        }
    }

    let value = [[${servAssCategory.tstDrip}]];
    ue.ready(function () {
        ue.execCommand('insertHtml', value);
    });
</script>

<script type="text/javascript">
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('tstDrip').execCommand('insertHtml', value)
    }

    function getContent() {
        var arr = [];
        arr.push(UE.getEditor('tstDrip').getContent());
        return(arr.join("\n"));
    }
</script>

<script type="text/javascript" th:inline="javascript">
    var json = {
        servProductVO: [[${servAssCategory}]]
    };
    layui.config({
        base: "/static/lay/",
        version:2019092600000
    }).extend({
        index: "lib/index",
        plat_servAssCategory_tst_drip_edit: "servcategory/zmn.plat.serv.ass.categ.tst.drip.edit"
    }).use(['index', 'plat_servAssCategory_tst_drip_edit']);
</script>